<?php

namespace App\Plugin\HostServer\Admin;

use App\Models\AdminLog;
use App\Plugin\HostServer\Models\PnHostSvOrderLog;
use App\Plugin\HostServer\Models\PnHostSvUserMoneyLog;

class UserMoneyLogController extends BaseController
{
    public $pageName='会员资金变动';

    /**
     * JSON 列表输出项目设置
     * @param $item
     * @return mixed
     */
    public function apiJsonItem($item)
    {
        $item->user_name=$item->user['name'];
        $item->type_name=PnHostSvUserMoneyLog::getType($item->type);
        return $item;
    }
    public function indexData()
    {
        $type=key_value_arr_to_select(PnHostSvUserMoneyLog::getType());
        return ['type'=>$type];
    }
    public function setModelAddRelaction($model)
    {
        return $model->with('user'); // TODO: Change the autogenerated stub
    }

    public function setModel()
    {
        return $this->model=new PnHostSvUserMoneyLog();
    }


}
